Reprinted from: http://blog.csdn.net/java_cxrs/article/details/3860870After a few days of practice and research finally can write a tank war game, after writing this program feel a lot of harvest, the knowledge of Java has a certain growth, and then prepare to continue to write a few small projects to practice J2SEBecause the
This article mainly introduces the key points, problems, and implementation code of the javascript simulated tank war game. If you need it, you can refer to the next section to summarize the key points and problems.
1. Inheritance in javascript. It is recommended that the parent class only provide method sharing, and the attributes should be written to the Child
, Will have an explosion, and will disappear on the screen.
2. System Performance requirements The game is based on the performance of the computer system configuration requirements are guaranteed to make the program fast, stable operation, the runtime can timely response, when the game player tank was destroyed, timely prompts the
Write a tank war game with knowledge points such as collections, Swing, threads, and so on in the Java language. (1) Draw the principle of the enemy tank: There is a Boolean type variable good in the Tank class. Used to judge the camp of tanks, when the
First, summarize the key points and problems encountered
Inheritance in 1.javascript, the best parent class provides only method sharing, attributes are written to their subclasses, and the constructors of the parent class and subclass are not promiscuous.
2.prototype simulate inherited code that should be written before all method definitions, otherwise the prototype object is changed and the method becomes undefined, such as:
Copy
Write in frontThe program is written five or six years ago when reading, there will be some irregular, I have put the code on GitHub, there is time to optimize the changes.Program operating mechanismDefines a jpanel, and then redraws it once every other short period of time.The redraw content is as follows:
Map information;
Enemy tanks;
our tanks;
The right game basic information;
The bomb
This article mainly introduces the JavaScript tank war game code re-compiled using TypeScript. It is mainly a small Summary Practice for my recent study of TypeScript and is recommended to my friends. I hope everyone will like it.
Source code download
I have uploaded the
so, Why not do that, what is the meaning of doing so, what are the benefits ... Wait a minute. Rather than saying that this can be achieved, and why it is not understood at all, then I think it will be very hard to finish a project, but perhaps nothing! Project Body: Object oriented thinking, I do not intend to speak this part of the content, so my first part of the body and code should be about GUI drawing technology! GUI Drawing Technology (yo
SOURCE download
Source I have uploaded to CSDN, no need for resources, download address: http://download.csdn.net/detail/zgynhqf/8565873.
The source code is developed using VS 2013 +typescript 1.4. When opened, displays the following figure:
Jstankgame 1.0: The old use of JS prepared
When I was a child, didn't you play overlord like me? So you know how to implement it with a program? I have been thinking about this problem since that time! I realized this ideal when I was studying! Tank wars are divided into eight categories. I upload one to my blog every other time, and then I will be able to play after the accumulation is complete! It is my pleasure to share with you, and I hope you can give suggestions! Leave a message for me.
Hongye Qingcheng one-click webpage game server + client (no need to install Java) source code, no need to install java
Qingcheng's one-click installation version server (including the client), without the need to install Java, yo
Idle and boring,I wrote three games. The basic knowledge points are as follows:Three elimination games:The principle is a two-dimensional array,Parkour games:Collision between tiledmap, Sprite, animation layer, and map layerAnti-tower games:Cocostudio UI Editor, animation Editor, scenario editor, and dynamic scenario acquisitionUi editor AnimationTiledmap, Action animation, automatic Node DeletionLevel Data configuration file, level switchAsynchronously load Resources----------------------------
The one-click installation version of the service side (including the client), no need to install Java, directly start the server to enter the game!!!New open to add the first GM method:Register your account and log into the game after creating a role name, enter the Gmgrade player role name in the server console 255That is, the role is successfully upgraded to G
The one-click installation version of the service side (including the client), no need to install Java, directly start the server to enter the game!!!New open to add the first GM method:Register your account and log into the game after creating a role name, enter the Gmgrade player role name in the server console 255That is, the role is successfully upgraded to G
explained after the entire example is written ......
Slgsimple (SLG game development Entry Example ):
This demo case should be the most complete of the sample programs currently provided. However, if blog posts only write three times, they will be interrupted due to a problem. If they are okay, they will not bother to write blog posts ......
Etcsimple (ETC game development example ):
Early trainer
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.